#include<stdio.h>
#include<stdlib.h>
int main()
{
	int i,n,num,f,flag;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&num);
		flag=0;
		for(f=2;f<=num;f=f+2)
		{
			if(num%f==0)
			{
				flag=1;
				printf("%d ",f);
			}
		}
		if(flag==0) printf("%d has no even factors",num);
		printf("\n");
	}
	return 0;
}


